package com.zrrd.test04;

/**
 * @author WanJl
 * @version 1.0
 * @title Addable
 * @description
 * @create 2024/6/1
 */
public interface Addable {
    int add(int x,int y);
}
class AddableDemo{
    public static void main(String[] args) {
        //如果代码块里的语句只有一条，那么return也可以省略
        useAddable((x,y)-> x+y);
    }
    public static void useAddable(Addable a){
        int add = a.add(1, 2);
        System.out.println(add);
    }
}
